<?php

declare (strict_types=1);
namespace App\Model;

use Hyperf\DbConnection\Model\Model;
/**
 * @property int $id 
 * @property int $material_id 
 * @property int $project_id 
 * @property int $admin_id 
 * @property string $sheet_name 
 * @property int $listorder 
 * @property int $report_num 
 * @property int $single_score 
 * @property string $sheet_description 
 * @property string $file_type 
 * @property \Carbon\Carbon $created_at 
 * @property \Carbon\Carbon $updated_at 
 * @property string $deleted_at 
 */
class MaterialProjectSheet extends Model
{
    /**
     * The table associated with the model.
     *
     * @var string
     */
    protected $table = 'material_project_sheet';
    /**
     * The attributes that are mass assignable.
     *
     * @var array
     */
    protected $fillable = [
        'sheet_name',
        'material_id',
        'project_id',
        'file_type',
        'sheet_description',
        'admin_id',
        'listorder',
        'report_num',
        'single_score'

    ];
    /**
     * The attributes that should be cast to native types.
     *
     * @var array
     */
    protected $casts = ['id' => 'int', 'material_id' => 'integer', 'project_id' => 'integer', 'admin_id' => 'integer', 'listorder' => 'integer', 'report_num' => 'integer', 'single_score' => 'integer', 'created_at' => 'datetime', 'updated_at' => 'datetime'];

    public function getFileTypeAttribute($field)
    {
        return $this->attributes[$field] = $field?explode(',',$field):[];
    }

}